﻿//
// GNS_SetMyInfo.h
// GameHall
//
// Created by mr.l on 16/2/3.
//
//

#ifndef __GameHall__GNS_SetMyInfo__
#define __GameHall__GNS_SetMyInfo__

#include "cocos2d.h"
#include "cocostudio/CocoStudio.h"
#include "ui/CocosGUI.h"
#include "GNS_YJFLayer.h"
#include "GNS_TipsWnd.h"

USING_NS_CC;
using namespace cocostudio::timeline;
using namespace ui;

class GNS_SetMyInfo : public GNS_YJFLayer
{
public:
    GNS_SetMyInfo();
    ~GNS_SetMyInfo();
    static GNS_SetMyInfo* createLayer();
    virtual bool init();
	virtual bool onTouchBegan(Touch *touch, Event *unused_event);
	virtual void onToucheMoved(Touch *touch, Event *unused_event);
	virtual void onTouchEnded(Touch *touch, Event *unused_event);
    CREATE_FUNC(GNS_SetMyInfo);
    void BtnCallBack(Ref *pSender , ui::Widget::TouchEventType type);
	void setMylogoFace();    //设置头像
	void SetNodeName(std::string CsbName);
	void ChangePassWord();
	void setButtonState();
private:
    void ShowInfo(bool bShow);
    void ShowEditor(bool bShow);
	void ShowheadType(bool isMan);   //显示头像类型
	void ShowPassWord(bool bShow);
	void changeButtonState(int tag);
private:
    Node * pMyInfo;
	Node * m_EditNode;
    Node * pPassWord;
    ScrollView * pFaceScrollView=nullptr;
    Layout * Panel_1=nullptr;
    /**
     *  UI层数据
     */
    ImageView * InputImage=nullptr;
    ImageView * LeveImage=nullptr;
    ImageView * GlodImage=nullptr;
    ImageView * IdImage=nullptr;
    ImageView * MobileImage=nullptr;
    ImageView * FacebgImage = nullptr;
    Text * levetext=nullptr;
    Text * glodtext=nullptr;
    Text * idyext=nullptr;
    Text * mobertext=nullptr;
private:
	TextField* m_oldpEidt = nullptr;  //老密码
	TextField* m_NewpEidt = nullptr;  //新密码
	TextField* m_NewApEidt = nullptr;  //重复新密码
	//---------
	TextField* m_NameEidt = nullptr;  //名字编辑框

	TextField *m_phonetext = nullptr; //手机号码编辑框

	GNS_TipsWnd* m_TipsLayer;   //提示框

	bool m_isMan = true;    //是否是男生头像
	int m_curPanelType = 1; // 面板类型

	Button * pUserInfo;
	Button * pEditorFace;
	Button * pModifyPassWord;
	Button * btnMan;
	Button * btnwoMan;

	Text * m_RecommendText = nullptr;
};

#endif /* defined(__GameHall__GNS_SetMyInfo__) */